<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户注册</title>
</head>

<body>
    <form action="" method="POST" onsubmit="return abc()">
        <p>帐号：<input id="a" type="text" placeholder="请输入用户名..." maxlength="5"></p>
        <p>密码：<input id="b" type="password"></p>

        <p>性别：
            <input type="radio" name="sex"> 男
            <input type="radio" name="sex" checked="checked"> 女
        </p>
        <p>学历：
            <input type="radio" name="student"> 本科
            <input type="radio" name="student" checked="checked"> 专科
        </p>
        <p >自我介绍：
            <textarea id="ziwo"></textarea>
        </p>
        <p>
            <input type="submit">
            <input type="reset">
        </p>
    </form>
   
    <script>
        function abc(){
            var name = document.getElementById("a").value;
            if(name=="admin"){
                var str = document.getElementById("ziwo").value;
                alert(str);
            }else{
                alert("用户名输入错误");
            }
        }
    </script>

</body>

</html>